package no.sachmuld.methodcombination.examples.reflection.clossimplestyle.around;

import no.sachmuld.methodcombination.api.BehaviourChain;
import no.sachmuld.methodcombination.api.reflection.Min;

/**
 *
 */
public class Foo {

    private BehaviourChain<FooBehaviour> chain = new BehaviourChain<>();

    public final int bar() {
        return new Min<Integer>().
                setAroundBehaviourClass(AroundFooBehaviour.class).
                build(PrimaryFooBehaviour.class, Foo.class, "bar").
                execute(this, chain);
    }

    final protected Foo with(FooBehaviour... behaviours) {
        chain.addAll(behaviours);
        return this;
    }

}
